<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Search Results {% if site_name %}{{ site_name }} : {% endif %}{% block head_title %}{% endblock %}</title>

    {% block head_extra %} {% endblock head_extra %}
    {% block head_script_includes %} {% endblock head_script_includes %}
    {% include "global_headcss.html" %}
  </head>
  <body {% block bodytag_attrs %}{% endblock %}>
    <div class="container">
<div class="header">

{% block header %}

<div class="span-17 last">
<h1><a href="/">DPLA Vertical Search Demo</a></h1>
</div>
{% endblock header %}
<form class="span-24">
              <input type="text" id="query" class="title" name="q"
		value="{{ query }}"> <!-- fill in value -->
<!-- a class="clear" id="clearQuery" href="#" title="Clear">×</a -->
              <input type="submit" id="submit" class="button" value="search"> 
<!-- facets -->

  {% if request.GET.fq %}
    <span class="facet">{{ fq }}
      &nbsp;<a href="{% url get_search_page %}?q={{ query }}" class="close">
  ☒</a></span>
    </span>
    <input type="hidden" name="fq" value="{{ fq }}"/>
  {% endif %}


<!-- 
<span class="facet">Limited to WRCA web site <a href="" class="close" title="remove limit">☒</a></span>
<span class="facet">Limited to PDF <a title="remove limit" class="close" href="#">☒</a></span>
-->

<div class="resultCount">{{ response.numFound }} results</div>
  {% if spelling_suggestion %}
    <span class="dym">Did you mean <a href="/search?q={{ spelling_suggestion }}">{{ spelling_suggestion }}</a>?</span>
  {% endif %}

</form>
{% block bodycontent %}
<hr/>
</div>
      <div class="results span-16 colborder">

                  {% if searchError %}
			<div class="error">
                  {{ searchError }}
			</div>
                  {% endif %}

                {% ifequal number_results 0 %}
<div class="notice">
There are no results for this query (<b>{{ query }}</b>{% if request.GET.fq %} {{fq }}{% endif %}). 
Please modify your search and try again.
</div>
</div>
      <div class="span-7 last">
                {% else %}


                  {% for result in results %}

                  <div class="hit">
                      <p><a href="{{ result.url }}"><strong>{{ result.title }}</strong></a><br />
                      {% for snippet in result.snippets %}
                      {{ snippet|safe }}…
                      {% endfor %}
                    <br />
                        <a href="{{ result.url }}">{{ result.url }}</a>&nbsp;&nbsp;
<!-- share save -->
                </p>
                 </div>
                  {% endfor %}




<!-- <input type="submit" class="button" value="|◀"></input> -->

<div class="pagination" style="float: right;">
                  {% if page_current.has_previous %}
                  <form method="GET" style="display: inline; text-decoration: none;" action="/search">
                      <input type="hidden" name="q" value="{{ query }}"/>
                      {% if fq %}
                          <input type="hidden" name="fq" value="{{ fq }}"/>
                      {% endif %}
                      <input type="hidden" name="pagenum" 
                          value="{{ page_current.previous_page_number }}"/>
                      <input type="submit" class="button" value="◀"></input>
                  </form>&nbsp;&nbsp;
                  {% endif %}
page 
                    <span style="font-size:1.5em;">{{ pagenum }}</span>
                    of {{ pager.num_pages }}
                  {% if page_current.has_next %}
                  <form method="GET" style="display: inline; text-decoration: none;" action="/search">
                      <input type="hidden" name="q" value="{{ query }}"/>
                      {% if fq %}
                          <input type="hidden" name="fq" value="{{ fq }}"/>
                      {% endif %}
                      <input type="hidden" name="pagenum" 
                          value="{{ page_current.next_page_number }}"/>
                      <input type="submit" class="button" value="▶">
                  </form>&nbsp;&nbsp;

                  {% endif %}
<!-- {{ response.numFound }} results -->

</div>
      </div>

      <div class="span-7 last">
        <h3>Limit to:</h3>
        <h4>source</h4>
	<ul>
{% for site, hits in response.facet_counts.facet_fields.site.items %}
{% if hits %}
  <li><a href="{% url get_search_page %}?q={{ query }}&fq=site:&quot;{{ site }}&quot;">{{ site }} ({{ hits }})</a>
  {% if request.GET.fq %}
    &nbsp;<a href="{% url get_search_page %}?q={{ query }}" class="close">☒</a>
  {% endif %}
</li>
{% endif %}
{% endfor %}
	</ul>
        <!-- h4>type</h4>
	<ul>
	<li>PDF (123)<a href="" class="close">☒</a></li>
	<li><a href="">HTML (123)</a></li -->
	</ul>


<hr>
{% endifequal %}
{% endblock bodycontent %}

<div class="prepend-1 prepend-top vert-banner">
<a href="https://spreadsheets.google.com/spreadsheet/viewform?formkey=dE54cWtlN1V0bU1HMjZEV0N3d25na0E6MQ">suggest a resource</a>
</div>
      </div>
<hr>



<div class="footer">
<div><a href="http://www.cdlib.org/">CDL's</a> DPLA Vertical Search Demo |
<a href="http://code.google.com/p/public-digital-collection/">project code</a> |
<a href="http://public-digital-collection.googlecode.com/hg/pdc-mock.pdf">wireframes (PDF)</a>
</div>
<div>
<a href="http://blogs.law.harvard.edu/dpla/">Digital Public Library of America Beta Sprint</a> --
<a href="http://cyber.law.harvard.edu/dpla/Beta_Sprint_Statements_of_Interest">Projects</a>
</div>
</div>
</div>
<!-- script type="text/javascript" src="/x.js"/ -->
  </body>
</html>
